package com.gg.fmallspringboot.controller;



import com.gg.fmallspringboot.service.UserAddrService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gg.fmallspringboot.model.Result;

@RestController
@RequestMapping("/useraddr")
public class UserAddrController {
    private UserAddrService userAddrService;

    @GetMapping("/{userId}")
    public Result getALL(@PathVariable("userId") Integer userId){
        return userAddrService.getAllById(userId);
    }

    @GetMapping("/add")
    public int addUserAddr(Integer userId) {
        return userAddrService.addUserAddr(userId);
    }

    @GetMapping("/update")
    public int updateUserAddr(Integer addrId){
        return userAddrService.updateUserAddr(addrId);
    }
    @GetMapping("/delete")
    public int deleteUserAddr(Integer addrId){
        return userAddrService.deleteUserAddr(addrId);
    }
}


